package com.example.demo.servlet;

import com.example.demo.bean.NoticeBean;
import com.example.demo.dao.NoticeDao;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.util.List;


@WebServlet("/notice.jsp")
public class NoticeServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        NoticeDao noticeDao = new NoticeDao();
        List<NoticeBean> notice = noticeDao.getList();
        req.setAttribute("notice", notice);
        req.getRequestDispatcher("noticetemp.jsp").forward(req, resp);
    }
}
